package api.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * 储存接口返回信息
 */
public class APImap {
    private APImap() {

    }

    private static Map<String, Object> apiMap = new HashMap<>();

    public static <T> T getApiMap(String apiName) {
        return (T) apiMap.get(apiName);
    }

    public static void setApiMap(String apiName, Object api) {
        if (apiMap.containsKey(apiName)) {
            apiMap.replace(apiName, api);
        } else {
            apiMap.put(apiName, api);
        }
    }
}
